package com.whpost.service.dao.t;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.whpost.service.entity.t.TWeek;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author YinZhuoyi
 * @since 2024-10-28
 */
public interface TWeekDao extends BaseMapper<TWeek> {


    //获取系统记录的年份信息
    @Select("select year from t_week  where year<=#{0} group by year order by year")
    List<String> getYearList(String year);

    @Select("select * from t_week where year=#{0}")
    List<TWeek> getWeekList(String year);

    @Select("select to_char(ksrq,'yyyy-MM-dd') || '|' || to_char(JZRQ,'yyyy-MM-dd') from t_week where year=#{year} and xh=#{xh}")
    String getLqsj(@Param("year") String year,@Param("xh") String xh);

    @Select("select to_char(jzrq-2,'yyyy-mm-dd') from t_week where year=#{year} and xh=#{xh}")
    String getWeekJzrq(@Param("year") String year,@Param("xh") int xh);
}
